
// <copyright file="DbStrategy.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The db strategy.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Data.SqlServer
{
    using System.Data;
    using System.Data.SqlClient;

    /// <summary>
    /// The db strategy.
    /// </summary>
    public sealed class DbStrategy : IDbStrategy
    {
        #region Static Fields

        /// <summary>
        /// The instance.
        /// </summary>
        private static readonly DbStrategy InstanceObject = new DbStrategy();

        #endregion Static Fields

        #region Constructors and Finalizers

        /// <summary>
        /// Prevents a default instance of the <see cref="DbStrategy"/> class from being created.
        /// </summary>
        private DbStrategy()
        {
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets the instance.
        /// </summary>
        public static DbStrategy Instance
        {
            get
            {
                return InstanceObject;
            }
        }

        /// <summary>
        /// Gets the bulk copier.
        /// </summary>
        public IBulkCopier BulkCopier
        {
            get
            {
                return SqlServer.BulkCopier.Instance;
            }
        }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The create connection.
        /// </summary>
        /// <returns>
        /// The <see cref="IDbConnection"/>.
        /// </returns>
        public IDbConnection CreateConnection()
        {
            return new SqlConnection();
        }

        /// <summary>
        /// The create dummy connection.
        /// </summary>
        /// <returns>
        /// The <see cref="IDbConnection"/>.
        /// </returns>
        public IDbConnection CreateDummyConnection()
        {
            return new DummyConnection();
        }

        #endregion Public Methods and Operators
    }
}
